package gsp420;

import java.awt.event.MouseEvent;

public class V2D
{
	public void set(MouseEvent e)
	{
		x = e.getX();
		y = e.getY();
	}
	public String toString()
	{
		return "("+x+","+y+")";
	}
	public static void main(String[] args)
	{
		V2D a = new V2D(1,1), b = new V2D(2,2);
		a.add(b);
		if(a.x == 3 && a.y == 3)
		{
			System.out.println("SUCCESS!!!");
		}
		else
		{
			System.out.println("fail :(");
		}
	}
	public V2D(int x, int y)
	{
		this.x = x;
		this.y = y;
	}
	public void clear()
	{
		x=0;y=0;
	}
	public V2D()
	{
		this(0,0);
	}
	public void add(V2D a)
	{
		x += a.x;
		y += a.y;
	}
	public float x, y;
}
